home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Fireworks 3 / Settings / Commands / Document / Reverse Frame Range.jsf < prev   
Encoding:
Text File  |  1999-11-19  |  795 b   |  31 lines

  1. // Copyright (c) 1999 Macromedia. All rights reserved.
  2.  
  3. var firstFrame = prompt("This command reverses a range of frames. Specify the starting frame:");
  4.  
  5. if (firstFrame != null){
  6.     // convert to Zero-based
  7.     firstFrame--;
  8.     var endFrame = prompt("Specify the ending frame:");
  9.     if (endFrame != null){
  10.         // convert to Zero-based
  11.         endFrame--;
  12.  
  13.         // Count the number of frames
  14.         // by checking the first layer (at index zero)
  15.         var numberFrames = fw.getDocumentDOM().frames.length;
  16.  
  17.         var reversedFrames = endFrame - firstFrame;
  18.  
  19.         if (numberFrames > reversedFrames){
  20.             // Move each frame to its new position
  21.             fw.getDocumentDOM().currentFrameNum = firstFrame;
  22.             for (count = firstFrame ; count <= endFrame ; count++){
  23.             fw.getDocumentDOM().reorderFrame(endFrame, count, false);
  24.              }
  25.         }
  26.     }
  27. }
  28.  
  29.  
  30.  
  31.